const state = {
  password: localStorage.getItem('password'),
  user: sessionStorage.getItem('user')
}
const mutations = {
  setData: function(state,data) {
    sessionStorage.setItem('user',JSON.stringify(data))
    state.userInfo = JSON.stringify(data)
  },
  deleteData: function(state) {
    sessionStorage.removeItem('user')
    state.userInfo = null
  }
}
const actions = {

}
const getters = {
  password: state => {
    return state.password
  },
  user: state => {
    return state.user
  }
}
export default {
state,
  mutations,
  actions,
  getters
}
